package 笔试2.百度.three;


import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

//--重复删相邻，最终子集几种
/*
00101

9
 */
public class Main2 {

    public static void main(String[] args) {
        String s = "00101";
        Scanner sc = new Scanner(System.in);
        s = sc.nextLine();
        qian(s);
        System.out.println(res.size());
    }

    static Set<String> res = new HashSet<>();
    static  void qian(String s) {
        if(s.length()==1){
            res.add(s);
            return;
        }

        res.add(s);

        Set<String> diedai = xianglinchuli(s);

        for (String ns : diedai) {
            if(res.contains(ns))continue; //剪纸
            qian(ns);
        }
    }


    static Set<String> xianglinchuli(String s) {
        Set<String> set = new HashSet<>();
        StringBuilder sb = new StringBuilder(s);
        char[] c = s.toCharArray();

        for (int i = 0; i < c.length-1; i++) {
            if(c[i]==c[i+1]){
                set.add(sb.deleteCharAt(i)+"");
                sb=new StringBuilder(s);
                set.add(sb.deleteCharAt(i+1)+"");
                sb=new StringBuilder(s);
            }
            else if(c[i]<c[i+1]){
                set.add(sb.deleteCharAt(i)+"");
                sb=new StringBuilder(s);

            }
            else if(c[i]>c[i+1]){
                set.add(sb.deleteCharAt(i+1)+"");
                sb=new StringBuilder(s);
            }
        }
        return set;
    }
}
